{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/css/base.css" media="all">
<style>
    html {
        background-color: #f2f2f2 !important;
    }
    .underline{
        text-decoration: underline;color: #00a2d4
    }
    tr th:last-child {
        border-right: 0 !important;
    }
    .layui-card-body {

        padding: 10px 1px!important;
    }
    .nav_search{
        padding-top: 5px;
    }
    .statistics_list{
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-right: .5rem;
        padding: 5px
    }
    .statistics_list div{
        margin-left: 2rem;
        font-size: 13px;
    }
    .layui-form-item {
        margin-bottom: 0 !important;
    }
    .underline{
        text-decoration: underline;color: #00a2d4
    }
    tr th:last-child {
        border-right: 0 !important;
    }
    .layui-card-body {

        padding: 10px 1px!important;
    }
    .pagination {
            display: inline-block;
            padding-left: 0;
            margin: 20px 0;
            border-radius: 4px;
        }
        .pagination>li {
            display: inline;
        }
        .pagination>li>a, .pagination>li>span {
            position: relative;
            float: left;
            padding: 6px 12px;
            margin-left: -1px;
            line-height: 1.42857143;
            color: #009688;;
            text-decoration: none;
            background-color: #fff;
            border: 1px solid #ddd;
        }
        .pagination>li:first-child>a, .pagination>li:first-child>span {
            margin-left: 0;
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;
        }
        .pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover {
            z-index: 3;
            color: #fff;
            cursor: default;
            background-color: #009688;;
            border-color: #009688;;
        }
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0,0,0,0);
            border: 0;
        }
        
    .layui-input-block{width: 50%}
</style>
<body>

<div class="layui-fluid layui-anim-fadein">
    <div class="layui-card">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                        <div style="display: flex;align-items: center;justify-content: space-between">
                            <div class="layui-btn-container" style="flex: 1">
                                <label  class="layui-btn layui-bg-cyan layui-btn-sm" onclick="exportexcel();">
                                    <i class="layui-icon layui-icon-export"></i>导出数据
                                </label>
                            </div>
                        </div>
                        <div class="nav_search">
                            <form class="layui-form search-form" lay-filter="search-form" style="display: flex;flex-wrap: wrap;flex: 1">

                                <div class="layui-form-item  layui-col-xs2">
                                    <div class="layui-inline" style="width: 98%">
                                        <select name="district_id" lay-filter="district_id">
                                            {foreach name="dist" item="v"}
                                            <option value="{$v.id}" <?php if($district_id == $v['id']){?>selected<?php }?>>{$v.title}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </form>
                        </div>
                    <div class="layui-card-body">
                        
						<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                        <ul class="layui-tab-title" style="padding-top: 10px">
                            <li class="{if $Request.action == 'statistics'}layui-this{/if}">
                                <a href="{:url('pro/statistics')}">检查概况表</a>
                            </li>
                            <li class="{if $Request.action == 'dangerStatistics'}layui-this{/if}">
                                <a href="{:url('pro/dangerStatistics')}">隐患统计表</a>
                            </li>
                            <li class="{if $Request.action == 'placeStatistics'}layui-this{/if}">
                                <a href="{:url('pro/placeStatistics')}">场所隐患清单</a>
                            </li>
                        </ul>
                        </div>
                        
							
                        <table class="layui-table">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>场所类别</th>
                                <th>检查场所总数</th>
                                <th>检查合格场所数</th>
                                <th>隐患总条数</th>
                                <th>整改隐患数</th>
                                <th>检查得分</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach name="list" item="vo"}
                            <tr>
                                <td >{$vo.id}</td>
                                <td >{$vo.title}</td>
                                <td >{$vo.count}</td>
                                <td >{$vo.hgcount}</td>
                                <td >{$vo.yhcount}</td>
                                <td >{$vo.yhhgcount}</td>
                                <td >{$vo.sum}</td>
                            </tr>
                            {/foreach}
                            {empty name="list"}
                                <tr>
                                    <td colspan="6" align="center">暂无数据</td>
                                </tr>
                            {/empty}
                            </tbody>
                        </table>
                        
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
{include file="public/footer" /}
<script>
    function exportexcel(){
        window.location.href='/'+$("#admin_map").val()+'/pro/statistics?excelExport=1&district_id='+{$district_id};
    }
    
    layui.use(['layer', 'form', 'laydate'], function () {
        var layer = layui.layer;
        var form = layui.form;
        var laydate = layui.laydate;
        
        form.on('select(district_id)', function (data) {
            console.log(data);
            window.location.href='/'+$("#admin_map").val()+'/pro/statistics?district_id='+data.value;
        });
    });
</script>
</html>